\(\int \cot ^4(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx\) [1100]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 25, antiderivative size = 88 \[ \int \cot ^4(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=b x-\frac {3 a \text {arctanh}(\cos (c+d x))}{8 d}+\frac {b \cot (c+d x)}{d}-\frac {b \cot ^3(c+d x)}{3 d}+\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d} \]

[Out]

b*x-3/8*a*arctanh(cos(d*x+c))/d+b*cot(d*x+c)/d-1/3*b*cot(d*x+c)^3/d+3/8*a*cot(d*x+c)*csc(d*x+c)/d-1/4*a*cot(d*
x+c)^3*csc(d*x+c)/d

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2917, 2691, 3855, 3554, 8} \[ \int \cot ^4(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=-\frac {3 a \text {arctanh}(\cos (c+d x))}{8 d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d}+\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {b \cot ^3(c+d x)}{3 d}+\frac {b \cot (c+d x)}{d}+b x \]

[In]

Int[Cot[c + d*x]^4*Csc[c + d*x]*(a + b*Sin[c + d*x]),x]

[Out]

b*x - (3*a*ArcTanh[Cos[c + d*x]])/(8*d) + (b*Cot[c + d*x])/d - (b*Cot[c + d*x]^3)/(3*d) + (3*a*Cot[c + d*x]*Cs
c[c + d*x])/(8*d) - (a*Cot[c + d*x]^3*Csc[c + d*x])/(4*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 2917

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)
*(x_)]), x_Symbol] :> Dist[a, Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Dist[b/d, Int[(g*Cos[e + f*x
])^p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]

Rule 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = a \int \cot ^4(c+d x) \csc (c+d x) \, dx+b \int \cot ^4(c+d x) \, dx \\ & = -\frac {b \cot ^3(c+d x)}{3 d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d}-\frac {1}{4} (3 a) \int \cot ^2(c+d x) \csc (c+d x) \, dx-b \int \cot ^2(c+d x) \, dx \\ & = \frac {b \cot (c+d x)}{d}-\frac {b \cot ^3(c+d x)}{3 d}+\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d}+\frac {1}{8} (3 a) \int \csc (c+d x) \, dx+b \int 1 \, dx \\ & = b x-\frac {3 a \text {arctanh}(\cos (c+d x))}{8 d}+\frac {b \cot (c+d x)}{d}-\frac {b \cot ^3(c+d x)}{3 d}+\frac {3 a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot ^3(c+d x) \csc (c+d x)}{4 d} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.04 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.74 \[ \int \cot ^4(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=\frac {5 a \csc ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}-\frac {a \csc ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}-\frac {b \cot ^3(c+d x) \operatorname {Hypergeometric2F1}\left (-\frac {3}{2},1,-\frac {1}{2},-\tan ^2(c+d x)\right )}{3 d}-\frac {3 a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}+\frac {3 a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}-\frac {5 a \sec ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}+\frac {a \sec ^4\left (\frac {1}{2} (c+d x)\right )}{64 d} \]

[In]

Integrate[Cot[c + d*x]^4*Csc[c + d*x]*(a + b*Sin[c + d*x]),x]

[Out]

(5*a*Csc[(c + d*x)/2]^2)/(32*d) - (a*Csc[(c + d*x)/2]^4)/(64*d) - (b*Cot[c + d*x]^3*Hypergeometric2F1[-3/2, 1,
 -1/2, -Tan[c + d*x]^2])/(3*d) - (3*a*Log[Cos[(c + d*x)/2]])/(8*d) + (3*a*Log[Sin[(c + d*x)/2]])/(8*d) - (5*a*
Sec[(c + d*x)/2]^2)/(32*d) + (a*Sec[(c + d*x)/2]^4)/(64*d)

Maple [A] (verified)

Time = 0.30 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.18

method result size
derivativedivides \(\frac {a \left (-\frac {\cos ^{5}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}+\frac {\cos ^{5}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{2}}+\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{8}+\frac {3 \cos \left (d x +c \right )}{8}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )+b \left (-\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}+\cot \left (d x +c \right )+d x +c \right )}{d}\) \(104\)
default \(\frac {a \left (-\frac {\cos ^{5}\left (d x +c \right )}{4 \sin \left (d x +c \right )^{4}}+\frac {\cos ^{5}\left (d x +c \right )}{8 \sin \left (d x +c \right )^{2}}+\frac {\left (\cos ^{3}\left (d x +c \right )\right )}{8}+\frac {3 \cos \left (d x +c \right )}{8}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )+b \left (-\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}+\cot \left (d x +c \right )+d x +c \right )}{d}\) \(104\)
parallelrisch \(\frac {3 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -3 a \left (\cot ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+8 b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-8 b \left (\cot ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-24 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +24 a \left (\cot ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+192 b x d -120 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+72 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+120 b \cot \left (\frac {d x}{2}+\frac {c}{2}\right )}{192 d}\) \(133\)
risch \(b x -\frac {-48 i b \,{\mathrm e}^{6 i \left (d x +c \right )}+15 a \,{\mathrm e}^{7 i \left (d x +c \right )}+96 i b \,{\mathrm e}^{4 i \left (d x +c \right )}+9 a \,{\mathrm e}^{5 i \left (d x +c \right )}-80 i b \,{\mathrm e}^{2 i \left (d x +c \right )}+9 a \,{\mathrm e}^{3 i \left (d x +c \right )}+32 i b +15 a \,{\mathrm e}^{i \left (d x +c \right )}}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{4}}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{8 d}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{8 d}\) \(151\)
norman \(\frac {b x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+b x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {a}{64 d}+\frac {7 a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}-\frac {7 a \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}+\frac {a \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}-\frac {b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{24 d}+\frac {7 b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}-\frac {7 b \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {b \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{24 d}+\frac {a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {3 a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}\) \(214\)

[In]

int(cos(d*x+c)^4*csc(d*x+c)^5*(a+b*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(-1/4/sin(d*x+c)^4*cos(d*x+c)^5+1/8/sin(d*x+c)^2*cos(d*x+c)^5+1/8*cos(d*x+c)^3+3/8*cos(d*x+c)+3/8*ln(cs
c(d*x+c)-cot(d*x+c)))+b*(-1/3*cot(d*x+c)^3+cot(d*x+c)+d*x+c))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 180 vs. \(2 (80) = 160\).

Time = 0.30 (sec) , antiderivative size = 180, normalized size of antiderivative = 2.05 \[ \int \cot ^4(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=\frac {48 \, b d x \cos \left (d x + c\right )^{4} - 96 \, b d x \cos \left (d x + c\right )^{2} - 30 \, a \cos \left (d x + c\right )^{3} + 48 \, b d x + 18 \, a \cos \left (d x + c\right ) - 9 \, {\left (a \cos \left (d x + c\right )^{4} - 2 \, a \cos \left (d x + c\right )^{2} + a\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 9 \, {\left (a \cos \left (d x + c\right )^{4} - 2 \, a \cos \left (d x + c\right )^{2} + a\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 16 \, {\left (4 \, b \cos \left (d x + c\right )^{3} - 3 \, b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{48 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{2} + d\right )}} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^5*(a+b*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/48*(48*b*d*x*cos(d*x + c)^4 - 96*b*d*x*cos(d*x + c)^2 - 30*a*cos(d*x + c)^3 + 48*b*d*x + 18*a*cos(d*x + c) -
 9*(a*cos(d*x + c)^4 - 2*a*cos(d*x + c)^2 + a)*log(1/2*cos(d*x + c) + 1/2) + 9*(a*cos(d*x + c)^4 - 2*a*cos(d*x
 + c)^2 + a)*log(-1/2*cos(d*x + c) + 1/2) - 16*(4*b*cos(d*x + c)^3 - 3*b*cos(d*x + c))*sin(d*x + c))/(d*cos(d*
x + c)^4 - 2*d*cos(d*x + c)^2 + d)

Sympy [F(-1)]

Timed out. \[ \int \cot ^4(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**4*csc(d*x+c)**5*(a+b*sin(d*x+c)),x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.42 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.22 \[ \int \cot ^4(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=\frac {16 \, {\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} - 1}{\tan \left (d x + c\right )^{3}}\right )} b - 3 \, a {\left (\frac {2 \, {\left (5 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} + 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{48 \, d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^5*(a+b*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/48*(16*(3*d*x + 3*c + (3*tan(d*x + c)^2 - 1)/tan(d*x + c)^3)*b - 3*a*(2*(5*cos(d*x + c)^3 - 3*cos(d*x + c))/
(cos(d*x + c)^4 - 2*cos(d*x + c)^2 + 1) + 3*log(cos(d*x + c) + 1) - 3*log(cos(d*x + c) - 1)))/d

Giac [A] (verification not implemented)

none

Time = 0.35 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.74 \[ \int \cot ^4(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=\frac {3 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 8 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 192 \, {\left (d x + c\right )} b + 72 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 120 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {150 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 120 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 8 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{192 \, d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^5*(a+b*sin(d*x+c)),x, algorithm="giac")

[Out]

1/192*(3*a*tan(1/2*d*x + 1/2*c)^4 + 8*b*tan(1/2*d*x + 1/2*c)^3 - 24*a*tan(1/2*d*x + 1/2*c)^2 + 192*(d*x + c)*b
 + 72*a*log(abs(tan(1/2*d*x + 1/2*c))) - 120*b*tan(1/2*d*x + 1/2*c) - (150*a*tan(1/2*d*x + 1/2*c)^4 - 120*b*ta
n(1/2*d*x + 1/2*c)^3 - 24*a*tan(1/2*d*x + 1/2*c)^2 + 8*b*tan(1/2*d*x + 1/2*c) + 3*a)/tan(1/2*d*x + 1/2*c)^4)/d

Mupad [B] (verification not implemented)

Time = 11.85 (sec) , antiderivative size = 221, normalized size of antiderivative = 2.51 \[ \int \cot ^4(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx=\frac {3\,a\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{8\,d}+\frac {5\,b\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}-\frac {5\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}+\frac {2\,b\,\mathrm {atan}\left (\frac {8\,b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+3\,a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3\,a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-8\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {a\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {a\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}-\frac {b\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}+\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d} \]

[In]

int((cos(c + d*x)^4*(a + b*sin(c + d*x)))/sin(c + d*x)^5,x)

[Out]

(3*a*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/(8*d) + (5*b*cot(c/2 + (d*x)/2))/(8*d) - (5*b*tan(c/2 + (d*x)
/2))/(8*d) + (2*b*atan((8*b*cos(c/2 + (d*x)/2) + 3*a*sin(c/2 + (d*x)/2))/(3*a*cos(c/2 + (d*x)/2) - 8*b*sin(c/2
 + (d*x)/2))))/d + (a*cot(c/2 + (d*x)/2)^2)/(8*d) - (a*cot(c/2 + (d*x)/2)^4)/(64*d) - (b*cot(c/2 + (d*x)/2)^3)
/(24*d) - (a*tan(c/2 + (d*x)/2)^2)/(8*d) + (a*tan(c/2 + (d*x)/2)^4)/(64*d) + (b*tan(c/2 + (d*x)/2)^3)/(24*d)